<template>
  <el-breadcrumb separator-class="el-icon-arrow-right">
    <el-breadcrumb-item :to="{path: '/suphome/notice'}">首页</el-breadcrumb-item>
    <el-breadcrumb-item v-for="item in breadList" :key="item.id">{{item}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>
<script>
export default {
  data() {
    return {
      menuList: [
        {
          id: 1,
          authName: '用户管理',
          children: [
            {
              authName: '全部用户',
              path: '/suphome/userinfo'
            },
            {
              authName: '普通用户',
              path: '/suphome/userdetail'
            }
          ]
        },
        {
          id: 2,
          authName: '帖子管理',
          children: [
            {
              authName: '精华帖',
              path: '/suphome/creamPost'
            },
            {
              authName: '普通帖',
              path: '/suphome/ordinPost'
            }
          ]
        },
        {
          id: 3,
          authName: '消息管理',
          children: [
            {
              authName: '所有消息',
              path: '/suphome/allMsg'
            }
          ]
        },
        {
          id: 4,
          authName: '积分管理',
          children: [
            {
              authName: '积分排名',
              path: '/suphome/integ'
            },
            {
              authName: '积分制度',
              path: '/suphome/system'
            }
          ]
        },
        {
          id: 5,
          authName: '版块管理',
          children: [
            {
              authName: '版块列表',
              path: '/suphome/college'
            }
          ]
        },
        {
          id: 6,
          authName: '系统通告',
          children: [
            {
              authName: '发布通告',
              path: 'suphome/announce'
            },
            {
              authName: '用户反馈',
              path: 'suphome/feekback'
            }
          ]
        }
      ],
      breadList: []
    }
  },
  created() {
    var path = window.sessionStorage.getItem('activePath')
    this.menuList.forEach(item => {
      item.children.forEach(supItem => {
        if (supItem.path === path) {
          this.breadList.push(item.authName)
          this.breadList.push(supItem.authName)
          return
        }
      })
    })
  }
}
</script>
<style lang="less" scoped>
</style>
